package com.yopinclub.util;

import java.io.File;

import android.os.Environment;
import android.os.StatFs;

public class SDCardUtil {

	public static long getSDCardState() {
		if (Environment.getExternalStorageState().equals(
				Environment.MEDIA_MOUNTED)) {
			File path = Environment.getExternalStorageDirectory(); // 取得sdcard文件路径
			StatFs stat = new StatFs(path.getAbsolutePath());
			long blockSize = stat.getBlockSize();
			long availableBlocks = stat.getAvailableBlocks();
			return blockSize * availableBlocks;// 返回可用空间大小
		}
		return 0;
	}
}
